Skip to content

feat: add getPackageAvailableVersions to public API and bump API to 1.1.0 - #1682

Open
Eduardo Villalpando Mello (edvilme) wants to merge 3 commits into
mainfrom
api-version-bump
Open

feat: add getPackageAvailableVersions to public API and bump API to 1.1.0#1682
Eduardo Villalpando Mello (edvilme) wants to merge 3 commits into
mainfrom
api-version-bump

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add PythonPackageGetterApi.getPackageAvailableVersions to the public API so consumers can query a package's available versions
  • bump @vscode/python-environments from 1.0.0 to 1.1.0
  • synchronize both API lockfile version fields
  • document the public API changes since the latest npm release

API changes

  • add PythonPackageGetterApi.getPackageAvailableVersions(environment, packageName): Promise<Pep440Version[] | undefined> — exposes a package's available versions (newest-first) to API consumers, delegating to the environment's package manager and resolving to undefined when version listing is unsupported
  • re-export Pep440Version for package manager version APIs
  • add PackageInfo.isTransitive and GetPackagesOptions.skipCache
  • add optional package manager hooks for watch targets, direct dependencies, tool versions, available package versions, and install-spec formatting
  • add the optional GetPackagesOptions parameter to PackageManager.getPackages and PythonPackageGetterApi.getPackages
  • update PackageManager.refresh and PythonPackageGetterApi.refreshPackages to return the refreshed package list when available

Validation

  • npm run lint
  • npm run compile-tests
  • npm run unittest (1494 passing, 5 pending)
  • git diff --check

@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code quality issues label Jul 30, 2026
@edvilme Eduardo Villalpando Mello (edvilme) changed the title chore: bump API package version to 2.0.0 chore: bump API package version to 1.1.0 Jul 30, 2026
Add PythonPackageGetterApi.getPackageAvailableVersions so API consumers
can query a package's available versions (newest-first), delegating to the
environment's package manager and resolving to undefined when unsupported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
@edvilme Eduardo Villalpando Mello (edvilme) changed the title chore: bump API package version to 1.1.0 feat: add getPackageAvailableVersions to public API and bump API to 1.1.0 Jul 31, 2026
@edvilme

Copy link
Copy Markdown
Contributor Author

Adding "skip tests" label since this functionality already exists but is now being exposed to the public API

Comment thread api/CHANGELOG.md
### Changed

- Added the optional `options?: GetPackagesOptions` parameter to `PackageManager.getPackages(environment, options?)` and `PythonPackageGetterApi.getPackages(environment, options?)`. Consumers can set `options.skipCache` to request fresh package data.
- Changed `PackageManager.refresh(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, allowing implementations to return the refreshed package list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a big change here- we would need to go to 2.0 if we want to change the return value of this method. Any other ways we could maybe do that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can look into having it return nothing for now, and then maybe discuss later on when reviewing the API

Comment thread api/CHANGELOG.md
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The published 1.0 package has top-level main and types; api/package.json now has only conditional exports. This accumulated unpublished change is not mentioned in the changelog.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preserve top-level main and types alongside exports, and test packed ESM and legacy CommonJS consumers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The api file and types are generated inline by the pipelines (#1619). I can update the changelog to mention that as well

Comment thread api/CHANGELOG.md
- Added the optional `options?: GetPackagesOptions` parameter to `PackageManager.getPackages(environment, options?)` and `PythonPackageGetterApi.getPackages(environment, options?)`. Consumers can set `options.skipCache` to request fresh package data.
- Changed `PackageManager.refresh(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, allowing implementations to return the refreshed package list.
- Changed `PythonPackageGetterApi.refreshPackages(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, exposing the refreshed package list to API consumers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would also want to packed-package contract tests before publishing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see two items about refresh and the exported top level items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues skip tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants